//
//  UIImage+EL.m
//  JTProject
//
//  Created by Yuki on 2021/3/9.
//

#import "UIImage+EL.h"

@implementation UIImage (EL)
///创建纯颜色的图片
+ (UIImage *)imageWithColor:(UIColor *)color{
    
    CGRect rect = CGRectMake(0.0f,0.0f,1.0f,1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context =UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *myImage =UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return myImage;
    
}
@end
